package cc.sheji.domain;

import lombok.Data;
import lombok.ToString;

@Data
@ToString

public class JsonResult<T> {

    public int code;
    public String message;
    public T data;

    public JsonResult(int code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public JsonResult(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public JsonResult() {

    }

    public static JsonResult Success(){
       return new JsonResult(ErrorCode.SUCCESS,"success");
    }

    public static JsonResult Success(Object data){
        return new JsonResult(ErrorCode.SUCCESS,"success",data);
    }


}
